package com.leyou.search.web;

import com.leyou.search.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * @author ShenMin
 * @date 2021/7/25 16:45
 * @description
 */
@RestController
@RequestMapping("/index")
public class IndexController {
    @Autowired
    IndexService indexService;

    @PutMapping("/saleable/{id}")
    public ResponseEntity<Void> modifyGoods(
            @RequestParam("saleable") Boolean saleable,
            @PathVariable("id") Long id
    ) {
        indexService.modifyGoods(saleable, id);
        return ResponseEntity.ok().build();
    }
}
